package com.explorati.design_pattern.hybrid.specification;

//not规格书
public class NotSpecification extends CompositeSpecification {

	// 传递一个规格书进行not操作
	private IUserSpecification spec;

	public NotSpecification(IUserSpecification spec) {
		this.spec = spec;
	}

	@Override
	public boolean isSatisfiedBy(User user) {
		return !spec.isSatisfiedBy(user);
	}

}
